Skip to content

Instantly share code, notes, and snippets.

@tanaikech
tanaikech / submit.md
Last active May 14, 2024 12:08
Retrieving Named Functions from Google Spreadsheet using Google Apps Script

Retrieving Named Functions from Google Spreadsheet using Google Apps Script

This is a sample script for retrieving the named functions from Google Spreadsheet using Google Apps Script.

Recently, the named functions got to be able to be used in Google Spreadsheet. Ref When several named functions are added, I thought that I wanted to retrieve these functions using a script. But, unfortunately, in the current stage, it seems that there are no built-in methods (SpreadsheetApp and Sheets API) for directly retrieving the named functions. So, I created this sample script.

In this script, the following flow is run.

@robrix
robrix / LC.hs
Created July 17, 2021 15:35
A catamorphism-based interpreter and an abstract machine for the untyped lambda calculus
type Name = String
-- first-order syntax
data Tm
= Var Name
| Abs Name Tm
| App Tm Tm
deriving (Eq, Ord, Show)
type Env = [(Name, Val)]
@jarlg
jarlg / sing.html
Created October 3, 2015 15:48
js example using webaudio to analyse mic input to control an oscillator
<!DOCTYPE html>
<html>
<head></head>
<body>
<script type=text/javascript>
navigator.getUserMedia = navigator.getUserMedia
|| navigator.webkitGetUserMedia
|| navigator.mozGetUserMedia;
@atifaziz
atifaziz / Unprotect-ProtectedData.ps1
Created March 31, 2017 06:25
Decrypting DPAPI-protected Base64 data from PowerShell
Add-Type -AssemblyName System.Security;
[Text.Encoding]::ASCII.GetString([Security.Cryptography.ProtectedData]::Unprotect([Convert]::FromBase64String((type -raw (Join-Path $env:USERPROFILE foobar))), $null, 'CurrentUser'))
@faim87
faim87 / Uzbekistan_phone_codes_regex_pattern.md
Last active May 14, 2024 12:07
Uzbekistan phone codes - regex pattern.

Mobile = /^9989[012345789][0-9]{7}$/

All = /^998(9[012345789]|6[125679]|7[01234569])[0-9]{7}$/

@insightsbees
insightsbees / Display PDF in Streamlit.py
Last active May 14, 2024 12:06
Display PDF in Streamlit
def show_pdf(file_path):
with open(file_path,"rb") as f:
base64_pdf = base64.b64encode(f.read()).decode('utf-8')
pdf_display = f'<iframe src="data:application/pdf;base64,{base64_pdf}" width="800" height="800" type="application/pdf"></iframe>'
st.markdown(pdf_display, unsafe_allow_html=True)
show_pdf('post1-compressed.pdf')
@nijave
nijave / tethering.sh
Created June 20, 2021 21:03
Android 10 Tethering Fix
#!/bin/sh
# Don't require DUN APN type
settings put global tether_dun_required 0
# use MagiskHide Props Config
# echo "net.tethering.noprovisioning=true" >> /system/build.prop
# iptables increment TTL for nat packets since carriers block these
# Requires kernel with CONFIG_IP_NF_TARGET_TTL enabled
@skyrising
skyrising / mojang-meta-urls.md
Last active May 14, 2024 12:05
Mojang Meta URLs
@janderudder
janderudder / wsl-disk-space.md
Last active May 14, 2024 12:04
Reclaim WSL's virtual disk unused space

Reclaim WSL's virtual unused disk space

Compact a WSL distro's virtual disk to reclaim unused storage space.

WSL's virtual disk grows when needed but doesn't shrink by itself. Here is how to reclaim the unused space. This can sometimes free hundreds of GBs for use on Windows.

prepare

@bearloga
bearloga / data.R
Last active May 14, 2024 12:03
Scripts for scraping divorce demographics by country from Wikipedia and plotting it in R with ggplot2 with the respective country flags in place of points.
## Script for scraping Wikipedia for data to use with the geom_flag() prototype
## CONTACT: Mikhail Popov (@bearloga // mikhail[at]mpopov[dot]com)
## URL: https://gist.github.com/bearloga/519a701a6a9bc7c3ba9f
# install.packages("import")
library(rvest) # install.packages("rvest")
library(magrittr)
import::from(dplyr, mutate, select, keep_where = filter, left_join, distinct)